home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / DockExtenders / LaunchPad / Source / Time.m < prev    next >
Text File  |  1993-12-16  |  1KB  |  42 lines

  1.  
  2. /*
  3.  * Copyright 1991 RightBrain Software.  All rights reserved.
  4.  *
  5.  * No part of this code may be reproduced in any form, compiled
  6.  * or source code, nor used for any purpose without the express
  7.  * written permission of RightBrain Software.
  8.  * 
  9.  * Entered into the public domain 12/15/93 by RightBrain Software.
  10.  *
  11.  */
  12.  
  13.  /* This simple abstract class returns the integer time (standard UNIX */
  14.  /* "seconds-since-Jan 1, 1970") and can also return a string that is */
  15.  /* formatted according to the users NXDateAndTime default variable. */
  16.  /* Objects that use this are for the display of the time when the  */
  17.  /* screen is locked, display of time in the Customize window (under */
  18.  /* the Standard Message popup menu) and by the subclass of */
  19.  /* application (SubApp) for the implementation of a trivial time */
  20.  /* bomb (during beta testing only.) */
  21.  
  22. #import <time.h>
  23. #import <sys/time.h>
  24. #import <appkit/Application.h>
  25. #import <stdio.h>
  26.  
  27. #import "Time.h"
  28.  
  29. @implementation Time
  30.  
  31.  
  32. - (int) currentIntTime
  33. {
  34.     struct timeval tod;
  35.     //struct tm *theTime;    
  36.  
  37.     gettimeofday(&tod, (struct timezone *) 0);
  38.     return tod.tv_sec;
  39. }
  40.  
  41. @end
  42.